#ifndef _DEV_UDP_H_
#define _DEV_UDP_H_

#ifdef __cplusplus
extern "C" {
#endif

#include <types.h>
#include "device.h"
#include "netcore.h"

struct udp_cfg
{
    const char         *ethname;

    ip_addr_t           local_ip;
    ip_addr_t           remote_ip[2];
    u16                 local_port;
    u16                 remote_port[2];
};

struct udp_device
{
    struct device       dev;
    struct udp_cfg      cfg;
    int                 remote_addr_index;
    ip_addr_t           peer_ip;
    u16                 peer_port;
};

int udp_dev_add(const char *name, const struct udp_cfg *cfg);
void udp_dev_del(device_t *dev);

#ifdef __cplusplus
}
#endif
#endif
